import {defineEventHandler} from "h3";
import fs from 'fs';

type MdFile = {
    name: string,
    content?: string
};

export default defineEventHandler(async (event) => {
    let params: MdFile = getQuery(event);
    try {
        return fs.readFileSync(`${process.cwd()}/public/mds/${params.name}.md`, 'utf8')
    } catch (e) {
        return e;
    }
})
